package com.nbsaas.boot.project.data.entity;

import com.nbsaas.boot.code.annotation.*;
import com.nbsaas.boot.jpa.data.entity.AbstractEntity;
import com.nbsaas.boot.jpa.data.entity.User;
import com.nbsaas.boot.rest.filter.Operator;
import jakarta.persistence.Entity;
import jakarta.persistence.FetchType;
import jakarta.persistence.ManyToOne;
import jakarta.persistence.Table;
import lombok.Data;

@Data
@FormAnnotation(title = "项目成员管理", model = "项目成员", menu = "1,88,92")
@Entity
@Table(name = "nb_project_member")
public class ProjectMember extends AbstractEntity {

    @SearchItem(label = "项目名称", name = "project", key = "project.id", type = InputType.select, operator = Operator.eq, classType = Long.class)
    @FieldConvert
    @FieldName
    @FormField(title = "项目名称", sortNum = "1", grid = true, width = "200", type = InputType.select, option = "project", required = true, col = 22)
    @ManyToOne(fetch = FetchType.LAZY)
    private Project project;

    @FieldConvert
    @FieldName
    @FormField(title = "成员姓名", sortNum = "1", grid = true, type = InputType.select, option = "tenantUser", col = 22)
    @ManyToOne(fetch = FetchType.LAZY)
    private User member;

//  /**
//   * 成员类型
//   */
//  @FormField(title = "成员类型", sortNum = "1", grid = true,ignore = true)
//  private ProjectMemberType memberType;

}
